home *** CD-ROM | disk | FTP | other *** search
/ Software USA 3 #11 / Software USA Volume 3.11.iso / pc / lifestyl / scrnsave / liggdw / install / install.dll / 1001 / 1 / LGDAPI.H < prev    next >
Text File  |  1996-12-08  |  6KB  |  199 lines

  1.  
  2. #define LGDCALL __export __stdcall
  3.  
  4. #define CMAGIC 0x2d48542bl
  5.  
  6. #define SCR_LEAVESBLANK      1
  7. #define SCR_MUSTHAVENONBLANK 2
  8. #define SCR_CONFIGDIALOG     4
  9. #define SCR_HELPAVAILABLE    8
  10. #define SCR_ERASEPALETTE     16
  11.  
  12. #define cColorCircle 30
  13.  
  14. typedef struct _TColorPalette
  15. {
  16.   short palVersion;
  17.   short palNumEntries;
  18.   PALETTEENTRY palPalEntry[256];
  19. } TColorPalette, *PColorPalette;
  20.  
  21. /*
  22. type
  23.       TColorPalette = record
  24.           palVersion: Word;
  25.           palNumEntries: Word;
  26.     palPalEntry: array[0..255] of TPaletteEntry;
  27.       end;
  28. */
  29. typedef unsigned char TColorCircle [cColorCircle];
  30.  
  31. typedef char STRING [256], *PSTRING;
  32.  
  33.   //{ information about screen saver }
  34.  
  35. typedef struct _TLgdInfoStruct
  36. {
  37.   long cBytes;
  38.   long lMagic;
  39.   long afSaverFlags;
  40.   PSTRING pstrModule;
  41.   char strTitle[32];
  42.   char strInfo[256];
  43.   char strHelpFile[256];
  44.   char strHelpKey[32];
  45.   void *pSaverData;
  46. }
  47. TLgdInfoStruct, *PLgdInfoStruct;
  48. /*
  49.   TLgdInfoStruct = record
  50.      cBytes: LongInt;
  51.      lMagic: LongInt;  { magic bytes }
  52.      afSaverFlags: LongInt; { combination of SCR_??? flags }
  53.      pstrModule: PSTRING; { name of module file }
  54.      strTitle: array[1..32] of char;  { short title for list boxes }
  55.      strInfo: array [1..256] of char;   { description }
  56.      strHelpFile: array[1..256] of char; { name of HELP file }
  57.      strHelpKey:  array[1..32] of char; { keyword for HELP file }
  58.      PSaverData: Pointer;
  59.   end;
  60.   PLgdInfoStruct = ^TLgdInfoStruct;
  61. */
  62.  
  63. typedef struct _TLgdSaverStruct
  64. {
  65.   long cBytes;
  66.   // fields filled by LGD
  67.   BOOL fPaletteAvailable;
  68.   HPALETTE hpalGlobal;
  69.   int cColors;
  70.   TColorCircle ColorCircle;
  71.   TColorPalette cp;
  72.   int iBPP;
  73.   // fields filled by saver module
  74.   HPALETTE hpalModule;
  75. }
  76. TLgdSaverStruct, *PLgdSaverStruct;
  77.  
  78.  
  79.   /*{ information exchanged when saver is started -
  80.      global information for all savers }
  81.   TLgdSaverStruct = record
  82.      cBytes: LongInt;
  83.      { in: fields filled by LGD }
  84.      fPaletteAvailable: bool; { cleared if you set fPaletteRequested }
  85.      hpalGlobal: HPalette;    { used for global palette }
  86.      cColors: integer;
  87.      ColorCircle: TColorCircle;
  88.      cp: TColorPalette;
  89.      iBPP: integer;           { display mode: bits per pixel }
  90.                                       { use fPaletteAvailable only with iBPP = 8 }
  91.      { out: fields filled by module }
  92.      hpalModule: HPalette;
  93.           { note: if fPaletteAvailable is TRUE, store your
  94.              color palette handle in hpalModule and set
  95.              fPaletteAvailable to FALSE (in ScrInit).
  96.              Be sure to reverse this in ScrDone!
  97.              Restore hpalModule with hpalGlobal!
  98.              If iBPP > 8, use your palette without registering it here!}
  99.   end;
  100.   PLgdSaverStruct = ^TLgdSaverStruct;
  101. */
  102.  
  103. typedef struct _TLgdModuleStruct
  104. {
  105.   long cBytes;
  106.   // fields filled by LGD
  107.   PLgdSaverStruct pss;
  108.   HWND hwndSaver;
  109.   HRGN hrngArea; // not used yet
  110.   long cxScreen, cyScreen;
  111.   STRING sCallerName;
  112.   STRING sSaverName;
  113.   long lLastTime;
  114.   // fields filled by screen saver module
  115.   BOOL fPaletteRequested;
  116.   HPALETTE hpalSaver;
  117.   BOOL fSupportsIdleFunction;
  118.   long lTimerDelay;
  119.   long lCallDelay;
  120.   BOOL fNoTimeout;        // signal for Randomizer: do not terminate saver now
  121.   BOOL fTerminateRequest; // set by LGD to terminate saver if fTerminateInhibit is set
  122.   BOOL fTerminateInhibit; // set by saver to prevent termination
  123.   BOOL fHasChildWindows;
  124.   void *pSaverData;
  125. }
  126. TLgdModuleStruct, *PLgdModuleStruct;
  127.  
  128. /*
  129.   { information specific to screen saver module }
  130.   TLgdModuleStruct = record
  131.      cBytes: LongInt;
  132.      { in: fields filled by LGD }
  133.      pss: PLgdSaverStruct;
  134.      hwndSaver: HWND;
  135.      hrgnArea:  HRGN;  { drawing region - not yet implemented }
  136.      cxScreen, cyScreen: LongInt; { window size }
  137.      sCallerName: string; { caller name - used for INI settings }
  138.      sSaverName: string;  { saver name  - used for INI settings }
  139.      lLastTime: LongInt;  { used internally for run delay }
  140.      { out: fields filled by screen saver }
  141.      fPaletteRequested: bool; { set this flag only if fPaletteAvailable is TRUE }
  142.                                           { reset it again in fpScrDone! }
  143.      hpalSaver: HPalette;     { saver specific color palette - set fPaletteRequested }
  144.      fSupportsIdleFunction: bool; { set true if ScrIdle shall be called }
  145.      lTimerDelay: LongInt;        { requested interval for ScrTimer; 0 = no timer; changes allowed in ScrInit and ScrTimer only! }
  146.      lCallDelay: LongInt;         { requested interval for ScrIdle; 0 = maximum }
  147.      fNoTimeout: bool;            { set true if screen save shall not timeout }
  148.      fTerminateRequest: bool;     { set by SCRNSAVE.PAS to terminate saver }
  149.      fTerminateInhibit: bool;     { set by saver to inhibit termination }
  150.      fHasChildWindows: bool;      { prevent WM_ERASEBKGND and SetPalette etc. }
  151.      PSaverData: Pointer;
  152.   end;
  153.   PLgdModuleStruct = ^TLgdModuleStruct;
  154. */
  155.  
  156. /*
  157.   fpScrInfo = Function (var lisInfo: TLgdInfoStruct): bool; stdcall;
  158.          { index 11; requests information about screen saver }
  159.  
  160.   fpScrAbout = Function (hwndParent: HWND): bool; stdcall;
  161.          { index 12; display information about screen saver }
  162.  
  163.          { these functions are called to execute the screen saver }
  164.   fpScrInit = Function (pmdModuleData: Pointer {PModuleData}): bool; stdcall;
  165.          { index 13; init screen saver - should save pointer to structure }
  166.   fpScrDone = Procedure (pmdModuleData: Pointer {PModuleData}); stdcall;
  167.          { index 14 }
  168.  
  169.   fpScrIdle = Procedure (pmdModuleData: Pointer {PModuleData}); stdcall; { called at maximum rate if requested by saver }
  170.          { index 15 }
  171.   fpScrTimer = Procedure (pmdModuleData: Pointer {PModuleData}); stdcall;{ called by timer with selected interval }
  172.          { index 16 }
  173.  
  174.   fpScrConfig = Function (pmdModuleData: Pointer; hwndParent: HWND): integer; stdcall;
  175.          { index 17; display configuration dialog }
  176. */
  177.  
  178. typedef struct _TModuleData
  179. {
  180.   void             *pmh; // internal use only
  181.   PLgdInfoStruct    pis; // always present
  182.   PLgdModuleStruct  pms; // allocated while module is running
  183.   STRING            strModule; // path to module
  184. }
  185. TModuleData, *PModuleData;
  186.  
  187. /*
  188.   TModuleData = record
  189.      pmh: PModuleHandle;    { allocated while module is loaded - internal use only }
  190.      pis: PLgdInfoStruct;   { always present }
  191.      pms: PLgdModuleStruct; { allocated while module is running }
  192.      strModule: string;     { path to module }
  193.   end;
  194.   PModuleData = ^TModuleData;
  195. */
  196.  
  197.  
  198.  
  199.